package model;

import java.util.Calendar;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

@Entity
public class Reserva {
	
	private Long id;
	private Locavel locavel;
	private Calendar dataReserva;
	
	@Column(name="reserva_id")
	@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	@NotNull(message="O item que se deseja locar nao pode ser null")
	@OneToOne
	public Locavel getLocavel() {
		return locavel;
	}
	
	public void setLocavel(Locavel locavel) {
		this.locavel = locavel;
	}
	
	@Temporal(value = TemporalType.DATE)
	public Calendar getDataReserva() {
		return dataReserva;
	}
	
	public void setDataReserva(Calendar dataReserva) {
		this.dataReserva = dataReserva;
	}
	
	

}
